import os
import _lzf

print dir(_lzf)

inp = 'Hello!'*22
out = _lzf.compress(inp)

print hex(len(inp)),"inp= <%s>" % inp
print hex(len(out)),"out =<%s>" % out
print "out =",  ' '.join(["%02X" % ord(x) for x in out])

out2 = _lzf.decompress(out)
print hex(len(out2)),"out2 =<%s>" % out2

try:
    out2 = _lzf.decompress(inp)
    print hex(len(out2)),"out2 =<%s>" % out2
except Exception,ex:
    print str(ex)
    print os.strerror(22)
